package com.ruoyi.school.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.school.domain.FirmwarePackage;
import com.ruoyi.school.domain.vo.FirmwarePackageVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 固件包信息表Mapper接口
 */
@Mapper
public interface FirmwarePackageMapper extends BaseMapper<FirmwarePackage> {

    /**
     * 查询固件包列表
     */
    List<FirmwarePackageVo> selectFirmwarePackageList(@Param("ew") FirmwarePackage firmwarePackage);

    /**
     * 分页查询固件包列表
     */
    IPage<FirmwarePackageVo> selectFirmwarePackagePage(Page<FirmwarePackageVo> page, @Param("ew") FirmwarePackage firmwarePackage);

    /**
     * 根据MD5查询固件包
     */
    FirmwarePackage selectByMd5(String md5Value);

    /**
     * 根据版本号和设备类型查询固件包
     */
    FirmwarePackage selectByVersionAndType(@Param("version") String version, @Param("deviceTypeId") Long deviceTypeId);

    /**
     * 更新固件包状态
     */
    int updateStatus(@Param("id") Long id, @Param("status") Integer status);
}
